# coding:utf8
import urllib2

class HtmlDownload(object):
	
	def download(self,url):
		if url is None:
			return None
		headers = {
			'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0',
			'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
			'Accept-Language': 'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3',
			'Connection': 'keep-alive'
		}
		request = urllib2.Request(url,headers = headers)
		response = urllib2.urlopen(request)
		if response.getcode() != 200:
			return None
		return response.read()